<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>LOG管理</title>
    {include file='header'}
</head>

<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a>首页</a>
            <a>日志</a>
        </span>
        
        <div style="float: right;">
            <!-- <input type="password" id="password" style="border:1px solid #ccc;padding:5px">
            <input type="button" class="layui-btn" value="确定" onclick="viewlog()"> -->
            <!--<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon">&#xe640;</i>清空</button>-->
            <a class="layui-btn layui-btn-small" href="javascript:location.replace(location.href);" title="刷新">
                <i class="layui-icon layui-icon-refresh-1"></i></a>
        </div>
    </div>
    <div class="x-body">
        <table class="layui-table">
            <thead>
                <tr>
                    <th>标题</th>
                    <th class="am-hide-sm-only">内容</th>
                    <th>操作人</th>
                     <th>时间</th>
                    
                    <th>订单号</th>
                    <!--<th>操作</th>-->
                </tr>
            </thead>
            <tbody>
                {foreach $data_list as $v}
                <tr id="data-list-{{$v.id}}">
                    <td>{$v.title}</td>
                    <td>{$v.memo}</td>
                    <td>{$v.admin_name}</td>
                    <td>{$v.add_time}</td>
                    
                    
                     <td>{$v.sn}</td>
                    <!--<td class="view-operation">-->
                    <!--    <button class="am-btn am-btn-danger am-btn-xs am-radius am-icon-trash-o submit-delete" onclick="remove({$v.id})"> 删除</button>-->
                    <!--</td>-->
                </tr>
                {/foreach}
               
            </tbody>
            </table>
            {$page|raw}
    </div>
    <script>
    function viewlog()
    {
        $.post("{:url('auth')}", { password: $("#password").val() }, function (res) {
            console.log(res)
                    if (res.code == 1) {
                            location.reload();
                    }
                    else {
                        layer.msg('操作失败');
                    }
                })
    }
        function remove(id) {
            if (confirm('确定要删除数据吗?')) {
                $.post("{:url('remove')}", { id: id }, function (res) {
                    if (res.code == 1) {
                        layer.msg('删除成功', { icon: 1, time: 1000 }, function () {
                            location.reload();
                        })
                    }
                    else {
                        layer.msg('操作失败');
                    }
                })
            }
        }
        function delAll(id) {
            if (confirm('确定要删除数据吗?')) {
                $.post("{:url('remove')}", {}, function (res) {
                    if (res.code == 1) {
                        layer.msg('删除成功', { icon: 1, time: 1000 }, function () {
                            location.reload();
                        })
                    }
                    else {
                        layer.msg('操作失败');
                    }
                })
            }
        }
    </script>
</body>

</html>